<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
$this->load->helper('url');
?><link rel="stylesheet" type="text/css" href="/static/css/upload.css">
<form id="ff" method="post" style="margin:10px 0px 0px 10px;display:block;">
	<input type="hidden" name="id" value="<?php echo $id;?>">
	<table style="font-size:12px;" cellspacing="5">
		<tr>
			<td>分类名称</td>
			<td><input type="text" class="easyui-validatebox" name="name" required="true" value="<?php echo $name;?>"></td>
		</tr>
		<tr>
			<td>英文名称</td>
			<td><input type="text" class="easyui-validatebox" name="en_name" required="true" value="<?php echo $en_name;?>"></td>
		</tr>
		<tr>
			<td>上级分类</td>
			<td><input class="easyui-combobox" 
							name="pid"
							data-options="
									url:'<?php echo site_url('article_class/selectdata/' . $pid);?>',
									method:'get',
									valueField:'id',
									textField:'text',
									panelHeight:'auto'
							">
			</td>
		</tr>
		<tr>
			<td>显示方式</td>
			<td>
			<select class="easyui-combobox" name="mod" id="mod" style="width:156px;" panelHeight="auto">
				<option value="parent" 
<?php
if ($mod == 'parent') {
?>selected<?php
}

?>>父级分类</option>
				<option value="list" 
<?php
if ($mod == 'list') {
?>selected<?php
}

?>>列表</option>
				<option value="page" 
<?php
if ($mod == 'page') {
?>selected<?php
}

?>>单页</option>
			</select>
			</td>
		</tr>
		<tr>
			<td>排序</td>
			<td><input type="text" class="easyui-validatebox" name="sort" value="<?php echo $sort;?>"></td>
		</tr>
		<tr>
			<td></td>
			<td>
			<button type="submit" class="easyui-linkbutton" iconCls="icon-ok">提交</button>
			</td>
		</tr>
	</table>
</form>

<script language="javascript">
$(function(){
	$('#ff').form({
		url:'<?php echo site_url('article_class/update');?>',
		onSubmit:function(){
			return $(this).form('validate');
		},
		success:function(data){
			data = eval('('+data+')');
			$.messager.alert('信息提示',data.msg,'info');
			if(data.error == 0){
				$('#win').window('close');
				$('#tt').treegrid('reload');
			}
		}
	});
	

    $('#pid').combobox({
		url:"<?php echo site_url('article_class/selectdata');?>",
		valueField:'id',
		textField:'text',
		editable:false,
		panelHeight:'auto',
		onLoadSuccess: function () {
			$(this).combobox("select", '<?php echo $pid;?>');
		}
	});
});
</script>